package demo.day11_CollectionAddpackage;

/**
 * @Auther: hjy(lc))
 * @Date: 2022/8/1-08-01-9:50
 * @Description：demo.day11_CollectionAddpackage   包装类的应用
 */
public class Integer_use {
    public static void main(String[] args) {
        int a =210;
        Integer a1 = Integer.valueOf(a);
        Integer a2 = 210;
        System.out.println(a1 == a2);   //a1=a2=210     false(值超过127则为false)      a1=a2=10   true
        System.out.println(new Integer(148).equals(new Integer(148)));
        System.out.println(a1);

        //最大值、最小值
        System.out.println(Integer.MAX_VALUE);
        System.out.println(Integer.MIN_VALUE);

        //十进制转其他进制
        System.out.println(Integer.toString(2,10));
        System.out.println(Integer.toString(2,2));
        System.out.println(Integer.toString(2,8));
        System.out.println(Integer.toString(2,16));

        //其他进制转10进制
        int i = Integer.parseInt("100",10);
        System.out.println(Integer.parseInt("1100100",2));
        System.out.println(Integer.parseInt("144",8));
        System.out.println(Integer.parseInt("64",16));

        //自动装箱
        System.out.println(a1.getClass());
    }
}
